﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Collections.Generic;
using ConfExpert.Utility;
using System.Data;
using System.Windows.Forms;

namespace Tailord.Reports
{
    public partial class KumasKesimTalebi : DevExpress.XtraReports.UI.XtraReport
    {

        DataSet DsFoy;
        public KumasKesimTalebi()
        {
            InitializeComponent();
        }

        public KumasKesimTalebi(DataSet DsFoy)
            : this()
        {
          
            trRef.Visible = barcode.Visible = false;

            this.DsFoy = DsFoy;
            BindDstoReport(false);
        }


        void BindDstoReport(bool Gelismis)
        {            
            barcode.ShowText = false;
            
            DataRow drFoyHeader = DsFoy.Tables[0].Rows[0];

            tcBelgeTarihi.Text = drFoyHeader["BelgeTarihi"].ToString();
            tcToplam.Text = drFoyHeader["ToplamIhtiyac"].ToString();

            DataTable dtDetail = DsFoy.Tables[1];
            string DetailTableName = dtDetail.TableName;
            
            this.DataMember = DetailTableName;
            this.DataSource = DsFoy;

            tcKumasKodu.DataBindings.Add("Text", null, DetailTableName + ".tcKumasKodu");
            tcTalepEden.DataBindings.Add("Text", null, DetailTableName + ".tcTalepEden");
            tcMetre.DataBindings.Add("Text", null, DetailTableName + ".tcMetre");
            tcTopNo.DataBindings.Add("Text", null, DetailTableName + ".tcTopNo");
            tcTopMt.DataBindings.Add("Text", null, DetailTableName + ".tcTopMt");
            tcRaf.DataBindings.Add("Text", null, DetailTableName + ".tcRaf");
            
            tcKumasKodu.ProcessDuplicatesMode = DevExpress.XtraReports.UI.ProcessDuplicatesMode.Merge;

        }
    }
}